package com.fs.sys.entityservice.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.fs.common.base.service.AbstractBaseEntityService;
import com.fs.sys.bean.dto.SysFileDTO;
import com.fs.sys.bean.query.SysFileQuery;
import com.fs.sys.domain.entity.SysFileEntity;
import com.fs.sys.domain.mapper.SysFileMapper;
import com.fs.sys.entityservice.SysFileEntityService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;

/**
 * 文件服务实现 
 * @author Coder Generator 2025-04-07 09:29:43 
 **/
@Service
public class SysFileEntityServiceImpl extends AbstractBaseEntityService<SysFileEntity, SysFileDTO, SysFileMapper, SysFileQuery> implements SysFileEntityService {
    @Override
    protected QueryWrapper<SysFileEntity> queryToWrapper(SysFileQuery query) {
        return this.createQueryWrapper()
                .eq(StringUtils.isNotBlank(query.getId()), "id", query.getId())
                .in(null != query.getIds(), "id", query.getIds())
                .orderByDesc("create_time");
    }
}